home *** CD-ROM | disk | FTP | other *** search
- /*
- * MandelVroom 2.0
- *
- * (c) Copyright 1987,1989 Kevin L. Clague, San Jose, CA
- *
- * All rights reserved.
- *
- * Permission is hereby granted to distribute this program's source
- * executable, and documentation for non-comercial purposes, so long as the
- * copyright notices are not removed from the sources, executable or
- * documentation. This program may not be distributed for a profit without
- * the express written consent of the author Kevin L. Clague.
- *
- * This program is not in the public domain.
- *
- * Fred Fish is expressly granted permission to distribute this program's
- * source and executable as part of the "Fred Fish freely redistributable
- * Amiga software library."
- *
- * Permission is expressly granted for this program and it's source to be
- * distributed as part of the Amicus Amiga software disks, and the
- * First Amiga User Group's Hot Mix disks.
- *
- * contents: this file decodes gadget or menu types to determine what help
- * file should be displayed in the help window.
- */
-
- #include "mandp.h"
-
- static char *HelpFile;
-
- ScrollHelpCmd(Msg)
- struct IntuiMessage *Msg;
- {
- struct Window *window;
- struct Gadget *gadget;
-
- window = Msg->IDCMPWindow;
- gadget = (struct Gadget *) Msg->IAddress;
-
- switch (Msg->Class) {
-
- case GADGETDOWN:
- ModifyIDCMP(window, window->IDCMPFlags | MOUSEMOVE);
- State = SCROLLHELPSTATE;
- break;
-
- case MOUSEMOVE:
- Page_File(HELPSCROLL);
- break;
-
- case GADGETUP:
- if (gadget->GadgetID == HELPSCROLL) {
- ModifyIDCMP(window, window->IDCMPFlags & ~MOUSEMOVE);
- }
- Page_File(HELPSCROLL);
- break;
- }
- }
-
- HelpMenuCmd( Msg )
- struct IntuiMessage *Msg;
- {
- register USHORT code;
-
- code = Msg->Code;
-
- HelpFile = NULL;
-
- if (code == MENUNULL)
- return;
-
- switch ( MENUNUM( code ) ) {
-
- case PROJECTMENU:
- HelpProjectMenu(code);
- break;
-
- case DISPLAYMENU:
- HelpDisplayMenu(code);
- break;
-
- case CALCULATEMENU:
- HelpCalculateMenu(code);
- break;
-
- case SPECIALMENU:
- HelpSpecialMenu(code);
- break;
- }
-
- if (HelpFile == NULL)
- DispErrMsg("No Help for that object",0);
- else
- ShowHelp("Mandelbrot:Help/",HelpFile);
-
- }
-
- /*
- * Decide what to do for Project menu's Items
- */
- HelpProjectMenu(code)
- USHORT code;
- {
- switch (ITEMNUM(code)) {
-
- case NEWITEM:
-
- switch( SUBNUM(code) ) {
- case 0:
- HelpFile = "NewMand";
- break;
-
- case 1:
- HelpFile = "NewJulia";
- break;
- }
- break;
-
- case HELPITEM:
- HelpFile = "Help";
- break;
-
- case CURITEM:
- HelpFile = "Current";
- break;
-
- case CLOSEPROJ:
- HelpFile = "CloseProj";
- break;
-
- case SAVEPROJ:
- case LOADITEM:
- HelpFile = "Load.Save";
- break;
-
- case SAVEILBM:
- HelpFile = "SaveILBM";
- break;
-
- case CANCELITEM:
- HelpFile = "CancelCmd";
- break;
-
- case QUITITEM:
- HelpFile = "Quit";
- break;
- }
- } /* HelpProjectMenu */
-
- /*
- * Decide what to do for Edit menu's Items
- */
- HelpDisplayMenu(code)
- USHORT code;
- {
- switch (ITEMNUM(code)) {
-
- case COLORITEM:
- HelpFile = "ColorPalette";
- break;
-
- case CYCLEITEM:
- HelpFile = "CycleControl";
- break;
-
- case CONTOURITEM:
- HelpFile = "ContourGen";
- break;
-
- case AUTOCNTRITEM:
- HelpFile = "AutoContour";
- break;
-
- case HISTOGRAMITEM:
- HelpFile = "Histogram";
- break;
-
- case DEPTHITEM:
- InitDepthSubs();
- HelpFile = "NumColors";
- break;
-
- case VIEWMODEITEM:
- InitViewModesSubs();
- HelpFile = "ScreenType";
- break;
-
- case SCREENITEM:
- InitSizeSubs();
- HelpFile = "ScreenSize";
- break;
-
- case BORDERITEM:
- InitBorderSubs();
- HelpFile = "Border";
- break;
- }
- } /* HelpDisplayMenu */
-
- /*
- * Decide what to do for Special Menu's Items
- */
- HelpCalculateMenu(code)
- USHORT code;
- {
- switch (ITEMNUM(code)) {
-
- case ZOOMITEM:
-
- switch(SUBNUM(code)) {
- case ZOOMIN:
- HelpFile = "ZoomIn";
- break;
- case ZOOMOUT:
- HelpFile = "ZoomOut";
- break;
- case ZOOMOFF:
- HelpFile = "ZoomClose";
- break;
- case ZOOMJULIA:
- HelpFile = "ZoomJulia";
- break;
- }
- break;
-
- case SCROLLITEM:
- HelpFile = "Pan";
- break;
-
- case LENSITEM:
- InitLensSubs();
- HelpFile = "Lens";
- break;
-
- case GENERATEITEM:
- HelpFile = "Generate";
- break;
-
- case GENERATORITEM: /* generator type */
- InitGenSubs();
- HelpFile = "Generator";
- break;
-
- case STATSITEM:
- HelpFile = "Statistics";
- break;
-
- case COUNTITEM:
- HelpFile = "MaxIteration";
- break;
- }
- } /* HelpCalcualteMenu */
-
- /*
- * Decide what to do for Special Menu's Items
- */
- HelpSpecialMenu(code)
- USHORT code;
- {
- switch (ITEMNUM(code)) {
-
- case PRESETITEM:
- HelpFile = "Presets";
- break;
-
- case ORBITITEM:
- HelpFile = "Orbit";
- break;
-
- case ORBITMATHITEM:
- HelpFile = "MathOrbit";
- break;
-
- case MAXORBITEM:
- HelpFile = "MaxOrbit";
- break;
- }
- } /* HelpCalculateMenu */
-
- /*
- * Perform functions for Gadget down messages
- */
- HelpGadgetCmd(Msg)
- struct IntuiMessage *Msg;
- {
- struct Gadget *gadget;
-
- gadget = (struct Gadget *) Msg->IAddress;
-
- HelpFile = NULL;
-
- switch (gadget->GadgetID >> WINDTYPEBITS & WINDMASK) {
-
- case PALTYPE:
- HelpPalGadget(gadget);
- break;
-
- case CONTYPE:
- HelpContGadget(gadget);
- break;
-
- case PICTTYPE:
- HelpPictGadget(gadget);
- break;
-
- case CYCTYPE:
- HelpCycGadget(gadget);
- break;
-
- case ORBTTYPE:
- HelpFile = "Orbit";
- break;
- }
-
- if (HelpFile != NULL)
- ShowHelp("Mandelbrot:Help/",HelpFile);
- else
- DispErrMsg("No Help for that object",0);
- }
-
- /*
- * Interpret the gadgets and do the right thing
- */
- HelpPalGadget(gadget)
- register struct Gadget *gadget;
- {
- switch (gadget->GadgetID >> TYPEBITS & TYPEMASK) {
-
- case PALPENS:
- HelpFile = "PalPens";
- break;
-
- case PALCNTLS:
- HelpPalCntl(gadget);
- break;
-
- case PALPOTS:
- HelpFile = "PalPots";
- break;
- }
- } /* HelpPalGadget */
-
- /*
- * We got a color palette command gadget
- */
- HelpPalCntl(gadget)
- register struct Gadget *gadget;
- {
- switch (gadget->GadgetID) {
-
- case PALCOPY:
- HelpFile = "PalCopy";
- break;
-
- case PALRANGE:
- HelpFile = "PalRange";
- break;
-
- case PALEXCG:
- HelpFile = "PalExchg";
- break;
- }
- } /* HelpPalCntl */
-
- HelpPictGadget(gadget)
- register struct Gadget *gadget;
- {
- switch (gadget->GadgetID) {
-
- case PICTCUR:
- HelpFile = "PictCur";
- break;
-
- case PICTGEN:
- HelpFile = "Generate";
- break;
-
- case PICTIN:
- HelpFile = "ZoomIn";
- break;
-
- case PICTOUT:
- HelpFile = "ZoomOut";
- break;
-
- case PICTJULIA:
- HelpFile = "ZoomJulia";
- break;
- }
- }
-
- /*
- * Figure out what to do for this contour gadget
- */
- HelpContGadget(gadget)
- struct Gadget *gadget;
- {
- switch (gadget->GadgetID >> TYPEBITS & TYPEMASK) {
-
- case CONTCNTLS:
- switch (gadget->GadgetID) {
- case CONTRECOL:
- HelpFile = "Paint";
- break;
-
- case CONTSET:
- HelpFile = "ContSet";
- break;
-
- case CONTSMTH:
- HelpFile = "ContSmooth";
- break;
-
- case CONTCUT:
- HelpFile = "ContCut";
- break;
-
- case CONTCOPY:
- HelpFile = "ContCopy";
- break;
-
- case CONTPASTE:
- HelpFile = "ContPaste";
- break;
-
- case CONTLAST:
- HelpFile = "ContLast";
- break;
-
- case CONTCEIL:
- HelpFile = "ContCeil";
- break;
- }
- break;
-
- case CONTSELS:
- HelpFile = "ContPens";
- break;
-
- case CONTPOTS:
- HelpFile = "ContPots";
- break;
- }
- }
-
- /*
- * Figure out what to do for this color cycle gadget
- */
- HelpCycGadget(gadget)
- struct Gadget *gadget;
- {
- switch (gadget->GadgetID >> TYPEBITS & TYPEMASK) {
-
- case CYCCNTLS:
- switch (gadget->GadgetID) {
- case CYCRANGE:
- HelpFile = "CycRange";
- break;
-
- case CYCDIR:
- HelpFile = "CycDir";
- break;
-
- case CYCSPEED:
- HelpFile = "CycSpeed";
- break;
-
- case CYCON:
- HelpFile = "CycOn";
- break;
- }
- break;
-
- case CYCRNUMS:
- HelpFile = "CycRNums";
- break;
- }
- }
-
-
-
-